<?php
	set_include_path (PHPPATH);
	require_once 'MDB2.php';
    /**
     * 
     * The search controller
     * @author Tri
     *
     */
    class search extends Application 
    {
        /**
         * 
         * Constructor
         */
        function __construct(&$tmpl)
        {            
            $this->tmpl = &$tmpl;        
        }

        /**
         * 
         * Default action
         */
         function index()
         {
            $currentView = $_REQUEST['view'];
            $this->assign("currentView", $currentView);
            $this->assign("backTitle", $_REQUEST['back']);
            $productModel = $this->getModel('ProductModel');
            
            $nameSearch = $productModel->getAllProductName();
            $brandSearch = $productModel->getAllBrand();
            $storeSearch = $productModel->getAllStore();

            
            $this->assign("nameSearch", $nameSearch);
            $this->assign("brandSearch", $brandSearch);
            $this->assign("storeSearch", $storeSearch);
            
            
            $this->assign("title", "Search");
            $this->loadPageTemplate('search');
         }
    }
?>